import Vue from 'vue'
import VueRouter from 'vue-router'

const Home = () => import('views/home/Home')
const Category = () => import('views/category/Category')
const Shopcar = () => import('views/shopcar/Shopcar')
const Myself = () => import('views/myself/Myself')
const Detail = () => import('views/detail/Detail')

Vue.use(VueRouter)

const routes = [
  {
    path: '',
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'home',
    component: Home
  },
  {
    path: '/category',
    name: 'category',
    component: Category
  },
  {
    path: '/shopcar',
    name: 'shopcar',
    component: Shopcar
  },
  {
    path: '/myself',
    name: 'myself',
    component: Myself
  },
  {
    path: '/detail/:iid',
    name: 'detail',
    component: Detail
  }
]

const router = new VueRouter({
  routes,
  // mode: 'history'
})

export default router
